package edu.dayu.config;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class PersonAspect {

    /**
     * 把这个切点提出来
     */
    @Pointcut("execution(* edu.dayu.service.PersonServiceImpl.test(..))")
    public void config(){

    }
//    @Before("execution(* edu.dayu.service.PersonServiceImpl.test(..))")
    @Before("config()")
    public void takeSeats(){
        System.out.println("调用方法之前的动作");
    }

    @After("config()")
    public void after(){
        System.out.println("调用方法之后的动作");
    }
}
